﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web;

namespace TTServer.Models
{
    public class ApiTools
    {
        private string msgModel = "{{\"server_time\":{0}}}";
        public ApiTools()
        {
        }
        public HttpResponseMessage MsgFormat(string NowTimeString)
        {
            JObject jo = JObject.Parse(NowTimeString);
            string timestring=jo["server_time"].ToString();   //拼夕夕api的json中时间的字段名
            string js = string.Format(msgModel, timestring);
            return new HttpResponseMessage { Content = new StringContent(js, System.Text.Encoding.UTF8, "application/json") };
        }

        }
}